Local QueryPlan generation and emulator execution#4312
Open
FabianMeiswinkel wants to merge 59 commits intoAzure:release/azure_data_cosmos-previewsfrom
Open
Local QueryPlan generation and emulator execution#4312FabianMeiswinkel wants to merge 59 commits intoAzure:release/azure_data_cosmos-previewsfrom
FabianMeiswinkel wants to merge 59 commits intoAzure:release/azure_data_cosmos-previewsfrom
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR introduces a new Cosmos SQL query crate and wires it into azure_data_cosmos to enable local query-plan generation (partition targeting + structural query info) and an in-memory evaluator intended for emulator/test scenarios.
Changes:
- Add new crate
azure_data_cosmos_queryimplementing a lexer, recursive-descent parser, query-plan analysis (PK extraction + structural info), and in-memory evaluation. - Add
azure_data_cosmosclient-side query-plan generation module plus extensive plan comparison tests. - Update workspace/crate dependency wiring (including workspace membership changes and lockfile refresh).
Reviewed changes
Copilot reviewed 15 out of 16 changed files in this pull request and generated 10 comments.
Show a summary per file
| File | Description |
|---|---|
| sdk/cosmos/query-engine-porting-plan.md | New design/porting plan for a Rust query engine subset and test strategy. |
| sdk/cosmos/azure_data_cosmos_query/src/ast/mod.rs | Defines Cosmos SQL AST types used by parser/plan/eval. |
| sdk/cosmos/azure_data_cosmos_query/src/lexer/mod.rs | SQL lexer producing tokens with spans, keywords, operators, comments handling. |
| sdk/cosmos/azure_data_cosmos_query/src/parser/mod.rs | Recursive descent + precedence parsing for Cosmos SQL into AST. |
| sdk/cosmos/azure_data_cosmos_query/src/plan/mod.rs | Query plan generation (PK filter extraction + structural QueryInfo). |
| sdk/cosmos/azure_data_cosmos_query/src/eval/mod.rs | In-memory WHERE matching + SELECT projection + simple TOP/OFFSET/LIMIT. |
| sdk/cosmos/azure_data_cosmos_query/src/value.rs | CosmosValue comparison semantics + JSON conversions + unit tests. |
| sdk/cosmos/azure_data_cosmos_query/src/lib.rs | Crate public surface (modules + parse + CosmosValue). |
| sdk/cosmos/azure_data_cosmos_query/Cargo.toml | New crate manifest added to workspace deps. |
| sdk/cosmos/azure_data_cosmos_driver/Cargo.toml | Switch azure_core dependency to workspace-sourced. |
| sdk/cosmos/azure_data_cosmos/tests/query_plan_comparison.rs | Adds exhaustive tests asserting full query plan equivalence (structural + PK). |
| sdk/cosmos/azure_data_cosmos/src/query/plan.rs | Adds client-side query plan generation + partition targeting resolution. |
| sdk/cosmos/azure_data_cosmos/src/query/mod.rs | Exposes new query::plan module. |
| sdk/cosmos/azure_data_cosmos/Cargo.toml | Adds dependency on query crate; changes feature wiring and versions. |
| Cargo.toml | Adds new workspace member; removes other Cosmos workspace members; adds workspace deps entry. |
| Cargo.lock | Lockfile regenerated to reflect new workspace graph. |
…om/Azure/azure-sdk-for-rust into users/fabianm/LocalQueryPlanPOC
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…FabianMeiswinkel/azure-sdk-for-rust into users/fabianm/LocalQueryPlanPOC
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…FabianMeiswinkel/azure-sdk-for-rust into users/fabianm/LocalQueryPlanPOC
…LocalQueryPlanPOC
…FabianMeiswinkel/azure-sdk-for-rust into users/fabianm/LocalQueryPlanPOC
Member
Author
|
/azp run rust - cosmos - weekly |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Member
Author
|
/azp run rust - cosmos - weekly |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Member
Author
|
/azp run rust - cosmos - weekly |
|
Azure Pipelines successfully started running 1 pipeline(s). |
…om/Azure/azure-sdk-for-rust into users/fabianm/LocalQueryPlanPOC
…LocalQueryPlanPOC
Member
Author
|
/azp run rust - cosmos - weekly |
|
Azure Pipelines successfully started running 1 pipeline(s). |
…LocalQueryPlanPOC
Member
Author
|
/azp run rust - cosmos - weekly |
|
Azure Pipelines successfully started running 1 pipeline(s). |
…FabianMeiswinkel/azure-sdk-for-rust into users/fabianm/LocalQueryPlanPOC
Member
Author
|
/azp run rust - cosmos - weekly |
|
Azure Pipelines successfully started running 1 pipeline(s). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR adds an option to generate query plans locally insteadof relying on Gateway I/O calls to get them.